package exercices;

public class SudokuSrc {
	private static int rp(int x, int y) {
		return (y * 9) + x;
	}

	public static final int[] a = new int[81];
	public static final int[] b = new int[81];
	static {
		loadA();
		loadB();
	}
	private static void loadA() {
		for (int i = 0; i < a.length; i++) {
			a[i] = 0;
		}
		a[rp(4, 0)] = 9;
		a[rp(2, 1)] = 2;
		a[rp(3, 1)] = 8;
		a[rp(5, 1)] = 1;
		a[rp(8, 1)] = 7;
		a[rp(0, 2)] = 3;
		a[rp(1, 2)] = 1;
		a[rp(5, 2)] = 2;
		a[rp(7, 2)] = 4;
		a[rp(0, 3)] = 8;
		a[rp(6, 3)] = 5;
		a[rp(1, 4)] = 2;
		a[rp(2, 4)] = 6;
		a[rp(4, 4)] = 5;
		a[rp(6, 4)] = 7;
		a[rp(7, 4)] = 3;
		a[rp(2, 5)] = 4;
		a[rp(8, 5)] = 1;
		a[rp(1, 6)] = 5;
		a[rp(3, 6)] = 7;
		a[rp(7, 6)] = 1;
		a[rp(8, 6)] = 9;
		a[rp(0, 7)] = 2;
		a[rp(3, 7)] = 6;
		a[rp(5, 7)] = 9;
		a[rp(6, 7)] = 8;
		a[rp(4, 8)] = 2;
	}
	private static void loadB() {
		for(int i = 0 ; i < b.length;i++)
			b[i]=0;
		b[rp(0,0)]=8;
		b[rp(2,1)]=3;
		b[rp(3,1)]=6;
		b[rp(1,2)]=7;
		b[rp(4,2)]=9;
		b[rp(6,2)]=2;
		b[rp(1,3)]=5;
		b[rp(5,3)]=7;
		b[rp(4,4)]=4;
		b[rp(5,4)]=5;
		b[rp(6,4)]=7;
		b[rp(3,5)]=1;
		b[rp(7,5)]=3;
		b[rp(2,6)]=1;
		b[rp(7,6)]=6;
		b[rp(8,6)]=8;
		b[rp(2,7)]=8;
		b[rp(3,7)]=5;
		b[rp(7,7)]=1;
		b[rp(1,8)]=9;
		b[rp(6,8)]=4;
		
		
	}
}
